/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.seaworldsoft.publish.entity;

import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 *
 * @author sam
 */
@Entity
@Table(name="sys_organization")
public class Organization {
     @Id
	@TableGenerator(name = "organization", table = "sys_generator", pkColumnName = "key_name", pkColumnValue = "OrgID", valueColumnName = "key_value", initialValue = 1, allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "organization")
     
     private int orgId;
     
     /**
      * 组织编码
      */
     @Column(length=20)
     private String orgNo;
     
     /**
      * 组织名称 全名称
      */
     @Column(length=100)
     private String orgFullName;
     
     /**
      * 组织名称 简称
      */
     @Column(length=50)
     private String orgName;
     
     /**
      * 组织机构介绍
      */
     @Column(length=150)
     private String orgDemo;
     
     /**
      * 组织关系编码 0.0.0.1
      */
     @Column(length=150)
     private String orgCode;
     
     /**
      * 是否为叶子节点
      */
     private boolean isLeaf;
     
     /**
      * 是否为父组织
      */
     private boolean isParent;
     
     /**
      * 父组织编码
      */
     private int parentOrgId;
     
     
     @OneToMany(mappedBy="org")
     private List<User> users;

    public int getOrgId() {
        return orgId;
    }

    public void setOrgId(int orgId) {
        this.orgId = orgId;
    }

    public String getOrgNo() {
        return orgNo;
    }

    public void setOrgNo(String orgNo) {
        this.orgNo = orgNo;
    }

    public String getOrgFullName() {
        return orgFullName;
    }

    public void setOrgFullName(String orgFullName) {
        this.orgFullName = orgFullName;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getOrgDemo() {
        return orgDemo;
    }

    public void setOrgDemo(String orgDemo) {
        this.orgDemo = orgDemo;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public boolean isIsLeaf() {
        return isLeaf;
    }

    public void setIsLeaf(boolean isLeaf) {
        this.isLeaf = isLeaf;
    }

    public boolean isIsParent() {
        return isParent;
    }

    public void setIsParent(boolean isParent) {
        this.isParent = isParent;
    }

    public int getParentOrgId() {
        return parentOrgId;
    }

    public void setParentOrgId(int parentOrgId) {
        this.parentOrgId = parentOrgId;
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }
     
     
     
     
}
